package com.yunxin.admin.system.infra.persistence.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunxin.admin.system.infra.persistence.entity.SysMenuDO;
import com.yunxin.admin.system.infra.persistence.entity.query.result.RouteResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;
/**
 *
 * @author zero°
 * @since 2023-05-22
 */
@Mapper
public interface SysMenuMapper extends BaseMapper<SysMenuDO> {

    /**
     * 获取路由菜单
     * @return List<RouteResult>
     */
    List<RouteResult> listRoutes();

    /**
     * 获取角色权限集合
     *
     * @param roles roles
     * @return Set<String>
     */
    Set<String> listRolePerms(@Param("roles") Set<String> roles);

    /**
     * 查询对应人员是否有指定菜单
     *
     * @param menuId
     * @param userId
     * @return
     */
    Integer checkMenuId(@Param("menuId") long menuId, @Param("userId") Long userId);
}
